using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Furiant.Figment.Core
{
    public static class Utility
    {
        public static T ClampNumber<T>(T min, T max, T value) where T : IComparable<T>
        {
            return value.CompareTo(min) < 0
                       ? min
                       : value.CompareTo(max) > 0
                             ? max
                             : value;
        }
    }
}
